/**
 *  手写一个merge函数
 *  merge([1,2,3],[5,3,6],[6,7,10])
 */
function merge() {
    const arr = []
    for (let i = 0; i < arguments.length; i++) {
        arr.push(...arguments[i])
    }
    const set = new Set(arr)
    console.log(set)
    return set
}

merge([1, 2, 3], [5, {a:1}, 6], [6, 7, 10])


function thousandBitSeparator(num) {
    return num && (
        num.toString().indexOf('.') != -1 ?
            num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
                return $1 + ",";
            }) :
            num.toString().replace(/(\d)(?=(\d{3}))/g, function($0, $1) {
                return $1 + ",";
            })
    );
}

function thousand(num){
    num.replace(/\d/,function(){

    })
}

